package com.cskaoyan.servlet;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

/**
 * @author stone
 * @date 2021/11/22 10:46
 */
public class OrderServlet extends HttpServlet {

    //OrderService orderService;


    @Override
    public void init() throws ServletException {
        if (getServletContext().getAttribute("applicationContext") != null) {
            return;
        }
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext();
        getServletContext().setAttribute("applicationContext",applicationContext);
        //super.init();
    }
}
